﻿@model Project

<link rel="stylesheet" href="~/css/components/project.min.css" />

@{
    var sizeClassName = "col-md-12";

    switch (Model.Size)
    {
        case ProjectSize.Big:
            sizeClassName = "col-md-12";
            break;

        case ProjectSize.Middle:
            sizeClassName = "col-md-8";
            break;

        case ProjectSize.Small:
            sizeClassName = "col-md-4";
            break;
    }
}

<div class="@sizeClassName">
    @await Component.InvokeAsync("FormLink", new FormLink()
    {
        Href = "/Admin/Project/MoveUp/",
        Text = "MoveUp",
        Paras = { {"id", Model.Id } },
        ClassName = "btn-edit btn btn-info",
        Warning = "Confirm MoveUp?"
    })

    <a class="btn-edit btn btn-warning" asp-controller="Project" asp-action="Edit" asp-route-id="@Model.Id">Edit</a>

    @await Component.InvokeAsync("FormLink", new FormLink()
    {
        Href = "/Admin/Project/Delete/",
        Text = "Delete",
        Paras = { { "id", Model.Id } },
        ClassName = "btn-edit btn btn-danger",
        Warning = "Confirm deletion?"
    })

    <div class="fh5co-blog">
        <div class="blog-imgbox">
            <a class="blog-bg" style="background-image:url(@Model.CoverUrl);" href="@Model.Link" target="_blank"></a>
        </div>
        <div class="blog-text">
            <h3>@Model.Name</h3>
            <p class="detail">@Html.Raw(Model.Detail)</p>
            <ul class="stuff">
                <li>
                    <a href="@Model.Link" target="_blank">@Model.Tip</a>
                </li>
            </ul>
        </div>
    </div>
</div>